package com.cong.leetcode.offer10;

public class FrogJump {
    int[] step = null;
    public int numWays(int n) {
        if (n < 0) {
            return 0;
        }
        if (n < 2){
            return 1;
        }
        step = new int[n + 1];
        step[0] = step[1] = 1;
        return recurNumWays(n);

    }
    private int recurNumWays(int n) {
        int num = step[n - 1] + step[n - 2];
        step[n] = num;

        return num;

    }
}
